<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>增加维权库内容</title>
    <script src="jquery.min.js"></script>
</head>

<body>
<script>
    $(function () {
        $('#submit').click(function () {
            $.ajax({
                url: 'https://api2.bmob.cn/1/classes/weiquancontent',
                type: 'POST',
                headers: {
                    'X-Bmob-Application-Id': 'ca20593b5ffe310b7630828b2659bbce',
                    'X-Bmob-REST-API-Key': '863c2b7e5d486549ee51ae331397ed5c'
                },
                contentType: 'application/json',
                dataType: 'json',
                data: JSON.stringify({
                    "weiquancontent": $('#weiquancontent').val()
                }),
                success: function (result) {
                    if(result.objectId != null || result.objectId != undefined) {
                        alert('保存成功，感谢你为我们做出的贡献！');
                        $('#weiquancontent').val('');
                    } else {
                        alert('保存失败了，感谢你为我们做出的贡献！');
                    }
                }
            })
        });

    })
</script>
    <h2>请在下方输入框中输入复地悦成相关内容，充实维权库！感谢大家的努力！</h2>
    <h2>请遵守相关法律，相关内容会审核才会使用！</h2>
    <h2>仅提供给相关投诉，不会存储个人资料！</h2>
    <textarea name="weiquancontent" id="weiquancontent" style="width: 100%; height: 300px;"></textarea>

    <button id="submit" style="width: 400px; height: 100px;">提交</button>
</body>
</html>